using System;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

using ProyectoFinal.Controles;



public partial class frmLogin : System.Web.UI.Page{
    
    String strcon="";
    conValidar val;


    protected void Page_Load(object sender, EventArgs e)
    {
            strcon = ConfigurationManager.ConnectionStrings["localConnectionString"].ConnectionString;

            val = new conValidar(strcon);
    }


    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
                     
            if (!val.validarUsuario(Login1.UserName, Login1.Password))
            {
                e.Authenticated = false;    
            }
            else
            {
                e.Authenticated = true;

            }
    }


    protected void OnLoggedIn(object sender, EventArgs e)
    {
        Session["ClsUsuario"] = val.GetUsuario;
        Response.Redirect("frmMain.aspx");
    }
}
